package cn.linstudy.vo.result;

import java.io.Serializable;
import lombok.Data;

/**
 * @Author XiaoLin
 * @Date 2022/1/6 17:25
 * @Description
 */
@Data
public class ResponseBean<T> implements Serializable {

    public static final long serialVersionUID = 42L;

    public static final int SUCCESS_CODE = 200;
    public static final int FAIL_CODE = 500;

    public static final ResponseBean<String> SUCCESS = new ResponseBean<String>(null);
    public static final ResponseBean<String> FAIL = new ResponseBean<String>(FAIL_CODE, null);

    private int code;
    private String msg;
    private T content;

    public ResponseBean(){}
    public ResponseBean(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public ResponseBean(T content) {
        this.code = SUCCESS_CODE;
        this.content = content;
    }

}
